package cn.com.fig.common;

import java.util.List;

/**
 * 
 * @Title: PaginationResponse.java
 * @Description: TODO(包含分页信息的查询结果)
 * @author 刘文成
 * @date 2015年5月14日
 */
public class PaginationResponse<T>  extends ReplyMsg{

	private static final long serialVersionUID = -1559059402072255789L;
	
	// 记录总数
	private long totalRows;
	// 一页显示的记录数
	private int numPerPage;
	
	/*easyui分页使用以下2个分页参数*/
	private int total; //总页数
	private List<T> rows; //数据集合

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public long getTotalRows() {
		return totalRows;
	}

	public void setTotalRows(long totalRows) {
		this.totalRows = totalRows;
		total = (int)Math.ceil(totalRows/(numPerPage * 1D));
	}

	public int getNumPerPage() {
		return numPerPage;
	}

	public void setNumPerPage(int numPerPage) {
		this.numPerPage = numPerPage;
	}
	
	
}
